﻿using SqlSugar;

namespace QingZhouLinYe_Web.Models
{
    [SugarTable("UserInfo")]
    public class UserInfo
    {
        [SugarColumn(IsIdentity =true,IsPrimaryKey =true,ColumnDescription ="主键Id")]
        public int Id { get; set; }

        [SugarColumn(ColumnDescription ="防火单位Id",IsNullable =true)]
        public int FangHuoDanWeiId {  get; set; }

        [SugarColumn(ColumnDescription ="用户名")]
        public string Name { get; set; }

        [SugarColumn(ColumnDescription = "密码")]
        public string PassWord { get; set; }

        [SugarColumn(ColumnDescription = "用户权限【0：超级管理员;1：管理员;2：用户】")]
        public int Authority { get; set; }


        [SugarColumn(IsIgnore =true)]     //CodeFist数据库时不映射字段
        [Navigate(NavigateType.ManyToOne,nameof(FangHuoDanWeiId))]    //定义多对一关系，多个用户属于一个防火单位
        public FangHuoDanWei FangHuoDanWei { get; set; }


    }
}